<template>
	<saleNearly ref="saleNearly" :onlyOneCategory="true"/>
</template>

<script>
import saleNearly from '@/components/saleNearly.vue';
import { listBySale } from '@/api/home.js'; //同 home 页面
import baseCategoryMixins from './mixins/baseCategoryMixins.js';
export default {
	name:"Left2CategorySale",	
	components: {
		saleNearly
	},	
	mixins: [baseCategoryMixins],
	data() {
		return {
			query:{
				year:(new Date()).getFullYear(),
				categoryId:1,//1-香榧 2-笋竹 3-山黄精
			},					
		};
	},
	
	methods: {		
		loadData() {
			// 获取指定分类的数据，见 query 数据结构
			listBySale(this.query).then(result => {
				console.log('listBySale Result = ', result);
				let listSale = result.data;
				this.$refs.saleNearly.initListData(listSale)
			});
		},		
	}
};
</script>
<style lang="scss" scoped>
</style>
